<?php
/* @var $this FaqController */
/* @var $model Faq */
?>

<?php
$this->breadcrumbs = array(
	'Faqs' => array('index'),
	$model->faqId,
);
?>

<div class="row-fluid">
    <div class="span12">
        <div class="grid simple">

			<div class="grid-title no-border">
				<br />
			</div>
			<div class="grid-body no-border">

				<?php
				$this->widget('zii.widgets.CDetailView', array(
					'htmlOptions' => array(
						'class' => 'table table-striped table-condensed table-hover',
					),
					'data' => $model,
					'attributes' => array(
						//'faqId',
						//'faqType',
						//'faqQid',
						array(
							'name' => 'faqModelId',
							'value' => $model->model->pageTitle,
						//'filter' => '',
						),
						//'faqModelId',
						'faqTitle',
						'faqContent',
						//'faqStatus',
						'faqUserName',
						'faqUserEmail',
					//'faqMostUseful',
					),
				));
				?>
				<table class="table table-hover no-more-tables project_images">
					<thead>
						<tr>							
							<th>Ответ</th>
							<th>Имя</th>
							<th>E-mail</th>
							<th>лучший ответ</th>									
						</tr>
					</thead>
					<tbody>						
						<?php if (!empty($answers)): ?>
							<?php foreach ($answers as $key => $answer): ?>
								<tr class="answers">
									<td>
										<?php echo $answer['faqContent']; ?>
									</td>
									<td>
										<?php echo $answer['faqUserName']; ?>
									</td>
									<td>
										<?php echo $answer['faqUserEmail']; ?>
									</td>
									<td>
										<?php echo $answer['faqMostUseful'] == 1 ? 'лучший ответ' : ''; ?>
									</td>									
								</tr>
							<?php endforeach; ?>
						<?php endif; ?>
					</tbody>
				</table>
			</div>
        </div>	
    </div>
</div>